import axios from "axios";

axios.defaults.baseURL = "/api";
axios.defaults.headers.common["Content-Type"] =
  "application/x-www-form-urlencoded";

export default {
  methods: {
    async getRunningProject() {
      const { data: res } = await axios.get("/em");
      return res.data;
    },
    async startProcess(projectId, processId) {
      const { data: res } = await axios.post("/em/run", {
        project: projectId,
        process: processId,
      });
      return res;
    },
    async stopProcess(projectId, processId) {
      const { data: res } = await axios.post("/em/stop", {
        project: projectId,
        process: processId,
      });
      return res;
    },
  },
};
